//
//  CHBubbleView.h
//  WZEfengAndEtong
//
//  Created by 李旭 on 16/8/11.
//  Copyright © 2016年 wanzhao. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MutiltimediaView.h"
#import "CBEmotionView.h"

typedef enum {
    CHBubbleMessageTypeSended = 0,
    CHBubbleMessageTypeReceived
} CHBubbleMessageType;

typedef enum {
    CHBubbleStyleText = 0,
    CHBubbleStylePicture,
    CHBubbleStyleVoice,
    CHBubbleStyleEmoticon,
    CHBubbleStyleFile,
    CHBubbleStyleShke,
    CHBubbleStyleVideo,
    CHBubbleStyleRedPacket
} CHBubbleStyle;


@interface CHBubbleView : UIView
@property (assign, nonatomic) CHBubbleMessageType type;
@property (assign, nonatomic) CHBubbleStyle style;
@property (retain, nonatomic) UIImageView  *img_voice;
@property (retain, nonatomic) NSString *text;
@property (retain, nonatomic) CBEmotionView *textLabel;
@property (assign, nonatomic) BOOL selectedToShowCopyMenu;
@property (retain, nonatomic) UIImageView *backgroundImageView;
@property (retain, nonatomic) MutiltimediaView *voiceView;
@property (retain, nonatomic) MutiltimediaView *pictureView;
@property (nonatomic, retain) MutiltimediaView *fileView;
@property (nonatomic,strong) MutiltimediaView *videoView;
@property (nonatomic,strong) MutiltimediaView *redpacketView;
@property (assign, nonatomic) BOOL isNotice;
@property (retain, nonatomic) UIImageView* foregroundImageView;


#pragma mark - Initialization
- (id)initWithFrame:(CGRect)rect
         bubbleType:(CHBubbleMessageType)bubleType
        bubbleStyle:(CHBubbleStyle)bubbleStyle
           isNotice:(BOOL)flag;
//- (void)initHornView;
#pragma mark - Drawing
- (CGRect)bubbleFrame;
- (UIImage *)bubbleImageWithStyle:(CHBubbleStyle)bubbleStyle;
- (UIImage *)bubbleImageHighlighted;

#pragma mark - Bubble view
+ (UIImage *)bubbleImageForTextAndPictureWithType:(CHBubbleMessageType)aType isNotice:(BOOL)flag;
+ (UIImage *)bubbleImageForVoiceWithType:(CHBubbleMessageType)aType  isNotice:(BOOL)flag;
+ (UIFont *)font;

+ (CGSize)bubbleSizeForText:(NSString *)txt;
+ (CGFloat)cellHeightForText:(NSString *)txt;

//+ (int)maxCharactersPerLine;
//+ (int)numberOfLinesForMessage:(NSString *)txt;
-(void) setBubbleFrameWithSize:(CGSize) size;
-(void)setImageBubbleFrameWithSize:(CGSize) size;
@end
